<?php
namespace app\admins\controller;
use think\Controller;
use Util\data\Sysdb;

/**
* 
*/
class BaseAdmin extends Controller
{
	public function __construct(){
		$this->db=new Sysdb();
		parent::__construct();
		$this->_admin = session('admin');
		// 未登录的用户不允许访问
		if(!$this->_admin){
            //如果session没有值,判定用户没有登录就跳转到登录页面
			header('Location: /admins.php/admins/Account/login');
			exit;
		}


		$site=$this->db->table('sites')->where(array('names'=>'site'))->item();
		$site&&$site['values']=json_decode($site['values']);


		$this->assign('site',$site);
		$this->assign('admin',$this->_admin);


		
    }
    
    
}

